<?php

function hat_sperre ($user)
{
	include("inc_configuration.php");
	
	$time = time();
	
	$differenz=$sperrzeit;
	
	$maxzeit=$time-$differenz;
	
	$q = "	SELECT tw.date AS rueckdate FROM $tbl_trainerwechsel tw, $tbl_combinations c 
				WHERE 
					tw.reason='Freiwillige Teamabgabe' AND 
					tw.combinationId=c.id AND 
					c.active=0 AND
					c.userId=$user
				ORDER by date DESC";
	$qe = mysql_query($q);
	$qec = mysql_num_rows($qe);
	
	if ($qec>0)
	{
		$qeo=mysql_fetch_object($qe);
		$rueckdate=$qeo->rueckdate;
		
		if ($rueckdate>$maxzeit)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}



?>